﻿using System;
using System.Threading;
using System.Web.Security;
using System.Web.UI;
using SouthernLand.Common;

namespace SouthernLand.Administrator
{
    public partial class Default : Page
    {
        protected void Page_Load()
        {
            Thread.Sleep(1500);
        }

        public void btLogin_OnClick(object sender, EventArgs args)
        {
            if (System.Web.Security.Membership.ValidateUser(txtUsername.Text, txtPassword.Text))
            {
                FormsAuthentication.SetAuthCookie(txtUsername.Text, false);
                Session["username"] = txtUsername.Text.Trim();
                Response.Redirect(Globals.ApplicationPath + "WebMaster/Default.aspx");
            }
            else
                lblMsg.Text = "Tên đăng nhập hoặc mật khẩu không hợp lệ.";
        }

    }
}